<?php
namespace app\api\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class SeckillOrder extends Validate
{
    //定义验证规则
    protected $rule = [
        'seckill_id|秒杀ID'=>'require',
        'goods_id|商品id'  => 'require',
        'address_id|收货地址'  => 'require|number',

    ];
    //定义验证提示
    protected $message = [
        'goods_data.require' => '商品信息必须填写',
        'address_id.require' => '请填写地址信息',
        'address_id.number' => '地址信息格式不正确',
        'is_point.require' => '积分信息必须填写',
        'is_point.number' => '积分格式不正确',
        'order_no.require' => '订单号必须填写',
        'order_no.alphaNum' => '订单号格式不正确',
        'pay_type.require' => '支付方式必须填写',
        'pay_type.number' => '支付方式格式不正确',
        'yu_deduction.number' => '余额格式不正确',
        'money.float' => '余额格式不正确',
        'safeword.number' => '支付密码错误',
        'safeword.require' => '请输入支付密码',

    ];
    //定义验证场景
    protected $scene = [
        'add'   =>  ['goods_data','is_point'],
        'seckill'   =>  ['goods_data','is_point'],
        'pay'   =>  ['id','pay_type','money','yu_deduction','safeword'],
    ];
}
